<?php

namespace App\Params\Common;

use App\Params\BaseParam;

class CommonListParam extends BaseParam
{
    public $page;
    public $page_size;
    public $mid;
    public $name;

    public function getMid()
    {
        return $this->mid;
    }
    public function getPage(): int
    {
        return (int)$this->page > 0 ? --$this->page : 0;
    }

    public function getPageSize(): int
    {
        return $this->page_size > 0 && $this->page_size < 100 ? (int)$this->page_size : 10;
    }

    public function getName()
    {
        return $this->name;
    }
}
